package com.learning.neo4j.baseapi.spring;

import com.learning.neo4j.baseapi.Movie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * ClassName: MovieRespon
 * Description:
 * Date: 2019/3/28 17:57 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MovieService {

    @Autowired
    private MovieRepository movieRepository;


    public void findAll() {
        Iterable<Movie> all = movieRepository.findAll();
        System.out.println(all);
    }


    public void getBetweenYearMovies() {
        List<Movie> movies = movieRepository.getBetweenYearMovies(1990, 2000);
        System.out.println(movies);
    }

}
